home *** CD-ROM | disk | FTP | other *** search
/ By Popular Request 2.0 / By Popular Request 2.0 (Arsenal Computer).ISO / amiga_2 / cnetjam2.lha / CNetJam2 / cnet / pfiles / fido / FREQ-List_Maker2 < prev    next >
Text File  |  1995-01-27  |  14KB  |  232 lines

  1. /**************************************************************************\
  2.            $VER: FREQ-List Maker, v2.1 by Dotoran (27-Jan-95)
  3. \**************************************************************************/
  4. options results;signal on SYNTAX;signal on ERROR;signal on IOERR
  5. tr=transmit;se=sendstring;gc=getchar;gu=getuser;gs=getscratch
  6. a='rexxsupport.library';if ~show('l',a) then if ~addlib(a,0,-30) then exit
  7. /**************************************************************************\
  8. |*                                                                        *|
  9. |*    The SETUP routine at the END of this file contains variables you    *|
  10. |*          WILL NEED to modify to suit your own System's needs.          *|
  11. |*                                                                        *|
  12. \**************************************************************************/
  13. /* A fairly powerful file-list generator in ARexx. To use it, add this line
  14.    to the bottom of Menu # 2; Available Everywhere Menu in "cnet:bbsmenu"
  15.    file:
  16.  
  17.             FREQS `31 | {#0pfiles:Fido/FREQ-List_Maker2}
  18.                         ^
  19.                     Control-Q
  20.  
  21.    You may also want to run this file as an event each night to insure the
  22.    listing is as up to date as possible. Here are the settings I'm currently
  23.    using for my event:
  24.  
  25.     Command: RunARexx
  26.        Args: pfiles:fido/FREQ-List_Maker2
  27.   [port(s)]: 1                              (whatever port you like)
  28.        Type: Immediate--force system idle
  29.        Days: Check ALL Seven
  30.        Time: 300                            (3 AM in the morning)
  31.       Valid: 100                            (Try to run between 3 and 4 AM)
  32.    Interval: 0                              (Run it once)
  33.     Iterate: 1                              (Only once a day)
  34.  
  35.    If you have large, active file areas, you might like to run it more often,
  36.    perhaps using these alternate values for Interval & Iterate:
  37.  
  38.    Interval: 1200     (Run every 12 hours)
  39.     Iterate: 2        (Twice a day)
  40.  
  41.    Interval: 800      (Run every 8 hours)
  42.     Iterate: 3        (Three times a day)
  43. */
  44. tr 'f1n2FREQ-List Maker, v2.0n1';call SETUP  /*** Main Program Code! ***/
  45. if head.0~='' & exists(head.0) then do;call open(f1,head.0,'r');do i=1 until eof(f1)
  46.   head2.i=readln(f1);end i;heads2=i-1;call close(f1);end;else head.0=''
  47. if foot.0~='' & exists(foot.0) then do;call open(f1,foot.0,'r');do i=1 until eof(f1)
  48.   foot2.i=readln(f1);end i;foots2=i-1;call close(f1);end;else foot.0=''
  49. tr 'Reading Paths:n1Reading Files:';changewhere "FREQ-List Maker!"
  50. do i=1 to paths;se '6H'path.i'6Hscanning...';a=showdir(path.i,'f','0A'x)
  51.   call open(f1,'ram:freqtemp','w');call writeln(f1,a);call close(f1)
  52.   address command 'SORT ram:freqtemp ram:freqtemp';a=''
  53.   call open(f1,'ram:freqtemp','r');do until eof(f1);z=readln(f1)
  54.   a=a||z'';end;a=strip(a,'t','');call close(f1);size.i=0
  55.   if a='' then do;j=0;se '6H[  0] Empty Directory!';path.i.1='No files in this directory.  We need some UPLOADS! Hint! Hint!';end
  56.   if a>'' then do j=1 until a='';parse var a file''a;se '6H['right(j,3)'] 'file''
  57.     b=statef(path.i'/'file);parse var b z s z z z z z c;if c=' ' then c='No description for this file.'
  58.     c=strip(space(c,1),'b');c=translate(c,' ',x2c('0A'));if length(c)>44 then do;z=lastpos(' ',c,44);c=left(c,z)'0A'x||copies(' ',31)substr(c,z);end
  59.     si=s;if s>1000 & s<999999 then do;si=s%1000;if s-si*1000>500 then si=si+1;si=si' KB';end
  60.     if s>999999 then do;si=s%1000000;if s-si*1000000>500000 then si=si+1;si=si' MB';end
  61.     if s<1000 then si='1 KB';path.i.j=left(file,25)right(si,6)' 'c;size.i=size.i+s;end j
  62. EMPTY:;tot.i=j;tsi=size.i;if size.i>1000 & size.i<999999 then do;tsi=size.i%1000;if size.i-tsi*1000>500 then tsi=tsi+1;tsi=tsi' KB';end
  63.   if size.i>999999 then do;tsi=size.i%1000000;if size.i-tsi*1000000>500000 then tsi=tsi+1;tsi=tsi' MB';end;tsi.i=tsi
  64. end i;address command 'DELETE ram:freqtemp';tab.1='     'left('Name of Directory Area',40)'Files         Bytes'
  65. tab.2=copies('=',78);do i=1 to paths;j=i+2;if tot.i=0 then t=' An Empty Directory';else t=right(tot.i,5)right(tsi.i,14)
  66. tab.j='     'left(path.i,40)left(t,19);end i;mag.1='     MAGIC Filename   Brief Description'
  67. tr 'n2Writing lists:';do i=1 to lists;parse var list.i name ext head foot con mag incs
  68.   tot=PARSE(incs,1,paths,0);tr '6H'name'';call open(f1,path||name,'w')
  69.   if head='Y' then do j=1 to heads2;call writeln(f1,head2.j);end j;if head='N' then do j=1 to heads;call writeln(f1,head.j);end j
  70.   call writeln(f1,center('FREQ-List Maker, v2.0 last used on 'date(),78))
  71.   if con='Y' then do;call writeln(f1,'0A'x||tab.1);call writeln(f1,tab.2);do j=1 to tot;inc=it.j+2;call writeln(f1,tab.inc);end j;call writeln(f1,tab.2'0A'x);end
  72.   if mag='Y' then do;call writeln(f1,'0A'x||mag.1);call writeln(f1,tab.2);do j=1 to magic;call writeln(f1,'     'magic.j);end j;call writeln(f1,tab.2'0A'x);end
  73.   do j=1 to tot;inc=it.j;top.1='0A0A'x||center(path.inc,78);top.2=copies('-',78);top.3='File Name             File Size Description            Created On: 'date()
  74.     top.4=copies('=',78);do k=1 to 4;call writeln(f1,top.k);end k;if tot.inc=0 then call writeln(f1,path.inc.1);do k=1 to tot.inc;call writeln(f1,path.inc.k);end k;bot.1=copies('=',78)
  75.     bot.2='Total Files: 'left(tot.inc,3)right(tsi.inc,15)right('List Updated Nightly!',47);call writeln(f1,bot.1);call writeln(f1,bot.2);end j;call writeln(f1,'')
  76.   if foot='Y' then do j=1 to foots2;call writeln(f1,foot2.j);end j;if foot='N' then do j=1 to foots;call writeln(f1,foot.j);end j;call close(f1)
  77. end i;tr 'Packing lists:';do i=1 to lists;parse var list.i name ext head foot con mag incs
  78.   tr '6H'name'';if exists(path||name'.'ext) then address command 'DELETE 'path||name'.'ext
  79.   if ext='LHA' then address command 'LHA a 'path||name'.LHA 'path||name;else address command 'ZIP -k 'path||name'.ZIP 'path||name;end i
  80. if index=1 then do;tr 'n1Writing Index: FFRS.index';tr '#4MAIL:FFRS/bin/FFRI MAIL:FFRS/ffrs.cfg}';end
  81. if copy2=1 then do;parse var list.1 name junk;se 'n1Copying 'name' as 'path'FileList...';address command 'COPY 'path||name' TEXT:FileList';tr 'Done!';end;exit
  82. PARSE: procedure expose it.;arg rng,min,max,srt;it.='';c=0;it=translate(rng,'  ','.,')
  83.   do a=1 to words(it);c=c+1;it.c=word(it,a);if index(it.c,'-')>0 then do;parse var it.c x'-'y
  84.   if y='' then y=max;if x='' then x=min;if x>y then do;d=x;x=y;y=d;end
  85.   if x<min|y>max|~datatype(x,'W')|~datatype(y,'W') then do;c=c-1;iterate;end;do b=x to y;it.c=b;c=c+1;end;c=c-1;end
  86.   else if it.c<min|it.c>max|~datatype(it.c,'W') then do;c=c-1;iterate;end;end;do i=1 to c;it.0=it.0||it.i' ';end;return c
  87.  
  88. SETUP:
  89.  /*************************************************************************\
  90.  |*                                                                       *|
  91.  |*        SysOp Variables; Modify These to Suit Your BBS's Needs!        *|
  92.  |*                                                                       *|
  93.  \*************************************************************************/
  94.  
  95.     path  = 'FREQ:'         /* Where to Create & Store FileLists.         */
  96.  
  97.     heads = 7   /* Total # of head.  lines. (Only if head.0='')           */
  98.     foots = 3   /* Total # of foot.  lines. (Only if foot.0='')           */
  99.     magic = 19  /* Total # of magic. lines defined below.                 */
  100.     lists = 5   /* Total # of list.  lines defined below.                 */
  101.     paths = 35  /* Total # of path.  lines defined below.                 */
  102.  
  103.     index = 1   /* ReCreate FFRS.index also? (1=Yes, 0=No)                */
  104.  
  105.     copy2 = 1   /* Should the list defined in "list.1" below be copied as
  106.                    FILELIST, a User Freq'able file in JamMail? (1=Y,0=N)  */
  107.  
  108. /***************************************************************************
  109.     If "head.0" contains a path/filename, then that file can be used as
  110.     the initial header text for each list, else use the text defined in
  111.     "head.1" thru "head.xx" variables. (Make sure "heads" above is equal
  112.     to the total number of header lines you defined below.
  113. ***************************************************************************/
  114.  
  115.     head.0='FREQ:!Header2'
  116.  
  117.     head.1='=============================================================================='
  118.     head.2='                                                                              '
  119.     head.3='        Frontiers Bulletin Board               Buffalo, New York 14220        '
  120.     head.4='                                                                              '
  121.     head.5='        SysOp: Dotoran (David Weeks)              (716) / 823 - 9892          '
  122.     head.6='                                                                              '
  123.     head.7='=============================================================================='
  124.  
  125. /***************************************************************************
  126.     If "foot.0" contains a path/filename, then that file can be used as
  127.     the post footer text for each list, else use the text defined in the
  128.     "foot.1" thru "foot.xx" variables. (Make sure "foots" above is equal
  129.     to the total number of footer lines you defined below.
  130. ***************************************************************************/
  131.  
  132.     foot.0='FREQ:!Footer2'
  133.  
  134.     foot.1='-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-'
  135.     foot.2='  Frontiers Bulletin Board File Request Listing.  Call (716)/823-9892 Today!  '
  136.     foot.3='-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-'
  137.  
  138. /***************************************************************************
  139.                 Structure for each "List." variable:
  140.  
  141. FileName  Extension   Use Head.0? Use Foot.0? Include   Include  Which Paths
  142.    to     LHA or ZIP  or Head.xx  or Foot.xx  Contents  Magics   to Include
  143.  Create  How to Pack?   Y or N      Y or N     Y or N   Y or N   CNet Parsed
  144. ***************************************************************************/
  145.  
  146.     list.1='FR_FILES  LHA Y Y Y Y 1-6,16-21,13,7-12,15,14,22-35'
  147.     list.2='FR_CFILES LHA N N Y Y 7-12,15,14,22-35'
  148.     list.3='FR_DFILES LHA N N Y Y 7-8,30,33-35'
  149.     list.4='FR_AFILES LHA N N N N 1-6'
  150.     list.5='FR_IFILES ZIP N N N N 16-21'
  151.  
  152. /***************************************************************************
  153.              Magic Names to include. Whatever Looks Pretty!
  154. ***************************************************************************/
  155.  
  156.     magic.1 ='FILES ...........Listing of ALL files on Frontiers BBS!'
  157.     magic.2 ='DFILES ..........Listing of CNet Amiga Files by Dotoran!'
  158.     magic.3 ='CFILES ..........Listing of ALL CNET AMIGA Specific Files!'
  159.     magic.4 ='AFILES ..........Listing of AMIGA Specific Files Only!'
  160.     magic.5 ='IFILES ..........Listing of IBM/COMPATIBLE Specific Files Only!'
  161.     magic.6 ='' /* Skip a line here */
  162.     magic.7 ='BBS_STATS .......BBS-Stats, v4.0b2 (Lots of Info About Your BBS)'
  163.     magic.8 ='CALL_LOG ........Call_Log, v3.0 (A very powerful Last XX Callers)'
  164.     magic.9 ='ATM_BANK ........ATM_BANK, v2.2 (The IBM-ANSI Time/Credits Bank)'
  165.     magic.10='GETUSERSP .......GU30_Package (Last Official Release)'
  166.     magic.11='GETUSERS ........Latest Updated GU30_Longs & GU30_Shorts Files'
  167.     magic.12='LEXICON .........LEXICON (Tallies Words/Sentences/Readabilities)'
  168.     magic.13='LOGACTS .........Logon Activities, v3.2 (Cleans Up Your Logon)'
  169.     magic.14='MURDER ..........Murder Motel, v1.5 (The IBM-ANSI Version!)'
  170.     magic.15='VIEW_LOG ........View Log, v4.1 (Lets your users read LOGS)'
  171.     magic.16='WOF .............Latest Version of Wheel of Fortune!'
  172.     magic.17='BBSTEXTHELP .....What do those oddball lines in BBSTEXT do?!?'
  173.     magic.18='TOOLKIT .........CNet Amiga ToolKit, v2.0 ARexx & MCI Tricks!'
  174.     magic.19='TOOLKITFIXES ....Some late additions & changes to ToolKit, v2.0!'
  175.  
  176. /***************************************************************************
  177.  
  178.    Paths to read files from. (These should MATCH those used in your Freq
  179.    Program's Config file. Copy the "DIRECTORY" lines from your "FFRS.cfg"
  180.    file if you're using FFRS, v2.2b9, then format them as shown below:
  181.  
  182.         Find "DIRECTORY " & Replace with "path.  ='"
  183.         Find "/" (at ENDS of lines) & Replace with "'"
  184.         Now add in the numbers within each "path." variable!
  185.  
  186. ***************************************************************************/
  187.  
  188.     path.1 ='UDBase0:Amiga_Games'
  189.     path.2 ='UDBase0:Amiga_Graphics'
  190.     path.3 ='UDBase0:Amiga_Music'
  191.     path.4 ='UDBase0:Amiga_Music_Players'
  192.     path.5 ='UDBase0:Amiga_Terminals'
  193.     path.6 ='UDBase0:Amiga_Utilities'
  194.     path.7 ='UDBase0:CNet_Dotoran'
  195.     path.8 ='UDBase0:CNet_Dotoran2'
  196.     path.9 ='UDBase0:CNet_Networking'
  197.     path.10='UDBase0:CNet_Gfiles'
  198.     path.11='UDBase0:CNet_Pfiles'
  199.     path.12='UDBase0:CNet_Updates'
  200.     path.13='UDBase0:Commodore_64_Files'
  201.     path.14='UDBase0:FIDONEWS'
  202.     path.15='UDBase0:HUBSTUFF'
  203.     path.16='UDBase0:IBM_Games'
  204.     path.17='UDBase0:IBM_Graphics'
  205.     path.18='UDBase0:IBM_Terminals'
  206.     path.19='UDBase0:IBM_Utilities'
  207.     path.20='UDBase0:IBM_Windows_Games'
  208.     path.21='UDBase0:IBM_Windows_Utility'
  209.     path.22='UDBase0:NODEDIFF'
  210.     path.23='GFILES:Funny_Files/BastardOperator'
  211.     path.24='GFILES:Funny_Files/BBS_Etiquette'
  212.     path.25='GFILES:Funny_Files/Bumper_Snickers'
  213.     path.26='GFILES:Funny_Files/Fun_Files_1'
  214.     path.27='GFILES:Funny_Files/Fun_Files_2'
  215.     path.28='GFILES:Funny_Files/Fun_Files_3'
  216.     path.29='GFILES:Funny_Files/Fun_Files_4'
  217.     path.30='GFILES:Funny_Files/Fun_Files_5'
  218.     path.31='GFILES:Funny_Files/Star_Trek_Parodies'
  219.     path.32='GFILES:BBS_Numbers'
  220.     path.33='GFILES:Miscelaneous'
  221.     path.34='GFILES:SysOps'
  222.     path.35='PFILES:Fido'
  223.  
  224. /**************************************** We need this RETURN right here! */
  225.   return
  226.  
  227. SYNTAX:;ERROR:;IOERR:;e1=' c9Errorcf: ca'rc' cf(ca'errortext(rc)'cf)';e2='  c9Linecf: ce'left(sigl,4)'c9Filecf:'
  228.     gu 1311992;a=result;gu 1311960;b=result;c='cb"ce'a||b'cb"';e2=e2' 'c;tr e1;tr e2;logentry e1;logentry e2;e=sourceline(sigl)
  229.     do while e~='';e3='c9Sourcecf: cd'left(e,37);tr e3;logentry e3;e=substr(e,37);end;bufferflush;exit
  230. /** Last Edited: 27-Jan-95 ************************************************\
  231. \****************************************** FRONTIERS BBS (716)/823-9892 **/
  232.